package org.millioncall.yueyoga.admin.service.impl;

import java.util.List;
import java.util.Map;

import org.millioncall.yueyoga.admin.dao.CheduleDetailsDAO;
import org.millioncall.yueyoga.admin.model.CheduleDetails;
import org.millioncall.yueyoga.admin.service.CheduleDetailsService;

public class CheduleDetailsServiceImpl implements CheduleDetailsService {
	
	private CheduleDetailsDAO cheduleDetailsDAO;

	public CheduleDetailsDAO getCheduleDetailsDAO() {
		return cheduleDetailsDAO;
	}

	public void setCheduleDetailsDAO(CheduleDetailsDAO cheduleDetailsDAO) {
		this.cheduleDetailsDAO = cheduleDetailsDAO;
	}

	@Override
	public int updateReserveCount(Map<String, Object> map) {
		return this.cheduleDetailsDAO.updateReserveCount(map);
	}

	@Override
	public int updateScheduleOver(Map<String, Object> map) {
		return this.cheduleDetailsDAO.updateScheduleOver(map);
	}

	@Override
	public boolean saveList(List<CheduleDetails> list) {
		
		for (CheduleDetails cd : list) {
			boolean b = this.cheduleDetailsDAO.addCheduleDetail(cd);
			if (!b) return false;
		}
		
		return true;
	}

}
